package demo.user.client;

import demo.user.dto.MenuDTO;
import demo.user.dto.StatusDTO;
import demo.user.dto.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.awt.*;
import java.util.List;

@FeignClient("demo-user")
public interface UserClient {

    /**
     * 根据用户名查询一条安全数据
     * @param userName
     * @return
     */
    @GetMapping("/query")
    UserDTO userLogin(@RequestParam("username") String userName, @RequestParam("password") String password);

    /**
     * 根据id获取用户权限
     * @param uid
     * @return
     */
    @GetMapping("/getStatus")
    StatusDTO getUserStatus(@RequestParam("id") Long uid);

    /**
     * 获取用户权限
     * @param uid
     * @return
     */
    @GetMapping("/userMenu")
    MenuDTO getUserMenu(@RequestParam("uid") Long uid, @RequestParam("uri") String uri);
}
